using System.Collections.Generic;
using QFramework.Framework;
using UnityEditor;
using UnityEngine;

namespace QFramework.Example._7.LevelManager
{
    public class LevelExample : MonoBehaviourSimplify
    {
        private void Start()
        {
            DontDestroyOnLoad(this);

            Framework.Manager.LevelManager.Init(new List<string>
            {
                "Home",
                "Level"
            });

            Framework.Manager.LevelManager.LoadCurrent();

            Delay(10.0f, Framework.Manager.LevelManager.LoadNext);
        }
#if UNITY_EDITOR
        [MenuItem("QFramework/Example/7.LevelManager", false, 7)]
        private static void MenuClicked()
        {
            EditorApplication.isPlaying = true;
            new GameObject().AddComponent<LevelExample>();
        }
#endif

        protected override void OnBeforeDestroy()
        {
        }
    }
}